unit uFrmInsertNewPlayer;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uFraPlayers, StdCtrls, gnugettext, uSQLS;

type
  TFrmInsertNewPlayer = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure ShowInsertPlayerForm();
  end;

var
  FrmInsertNewPlayer: TFrmInsertNewPlayer;

implementation

uses uFrmMain, uUtils;
{$R *.dfm}

procedure TFrmInsertNewPlayer.FormCreate(Sender: TObject);
begin
  gnugettext.TranslateComponent(self);
end;

procedure TFrmInsertNewPlayer.FormKeyPress(Sender: TObject; var Key: Char);
begin
  // The Escape key is #27.
  if Key = #27 then
    close;
end;

procedure TFrmInsertNewPlayer.ShowInsertPlayerForm();
begin
  FrmMain.FraPlayersMain.Parent := self;
  self.Height := FrmMain.FraPlayersMain.Height;
  self.Width := FrmMain.FraPlayersMain.Width;
  FrmMain.GetGridData(FrmMain.FraPlayersMain.stg_Players, SQL_Players, false);
  ShowModal();
end;

end.
